package com.cohen.playerobject;
import java.util.Random;

public class player {

	private String playerName;
	private String playerRace;
	private String playerClass;
	//Primary attributes
	private int playerAgility;
	private int playerStrength;
	private int playerIntelligence;
	//Secondary attributes
	//	mage and rouge
	private int playerCunning;
	//	warrior and rouge
	private int playerStamina;
	//	warrior and mage
	private int playerSpirit;
	//general
	private int playerLuck;
	private int playerCharisma;
	private int playerPerception;
	//Specialization array initialization
	//mage
	String mageSpecializations[];
	//rogue
	String rogueSpecializations[];
	//warrior
	String warriorSpecializations[];
	//Player's specializations
	String chosenSpecializations[] = new String[5];

	public static int assignPrimaryAttribute(){
		//For primary stats that should be >15
		Random statGenerator = new Random();
		return (statGenerator.nextInt(6) + 15);
	}

	public static int assignSecondaryAttribute(){
		//for secondary stats that should be >10
		Random statGenerator = new Random();
		return (statGenerator.nextInt(11) + 10);
	}

	public static int assignGeneralAttribute(){
		//for misc stats that should be at least five
		Random statGenerator = new Random();
		return (statGenerator.nextInt(16) + 5);
	}

	//setters
	void setName(String name){
		playerName = name;
	}
	void setRace(String race){
		playerRace = race;
	}
	void setClass(String Class){
		playerClass = Class;
	}
	void setIntelligence(int intelligence){
		playerIntelligence = intelligence;
	}
	void setAgility(int agility){
		playerAgility = agility;
	}
	void setStrength(int strength){
		playerStrength = strength;
	}
	void setCunning(int cunning){
		playerCunning = cunning;
	}
	void setSpirit(int spirit){
		playerSpirit = spirit;
	}
	void setStamina(int stamina){
		playerStamina = stamina;
	}
	void setLuck(int luck){
		playerLuck = luck;
	}
	void setCharisma(int charisma){
		playerCharisma = charisma;
	}
	void setPerception(int perception){
		playerPerception = perception;
	}
	void setSpecialization(String specializationName, int specializationNumber){
		chosenSpecializations[specializationNumber] = specializationName;
	}
	//getters
	String getName(){
		return playerName;
	}
	String getRace(){
		return playerRace;
	}
	//class had to be lower case here because "getClass" is something, apparently
	String getclass(){
		return playerClass;
	}
	int getIntelligence(){
		return playerIntelligence;
	}
	int getAgility(){
		return playerAgility;
	}
	int getStrength(){
		return playerStrength;
	}
	int getCunning(){
		return playerCunning;
	}
	int getSpirit(){
		return playerSpirit;
	}
	int getStamina(){
		return playerStamina;
	}
	int getLuck(){
		return playerLuck;
	}
	int getCharisma(){
		return playerCharisma;
	}
	int getPerception(){
		return playerPerception;
	}
	String getSpecialization(int specializationNumber){
		return chosenSpecializations[specializationNumber];
	}
	//"specializations"
	//mage
	//String mageSpecializations[9] = new String ("Pyromancy", "Hydromancy", "Geomancy", "Stratomancy", "Necromancy", "Biomancy", "Astromancy", "Heliomancy", "Metamancy");
	String generateSpecializations(int arrayPlace, String chosenClass){

		if (chosenClass.equalsIgnoreCase("mage")){
			String mageSpecializations[] = new String[]{
					"Pyromancy",
					"Hydromancy",
					"Geomancy",
					"Stratomancy",
					"Necromancy",
					"Astromancy",
					"The Arcane",
					"Wands",
					"Staves"
			};
			return mageSpecializations[arrayPlace];
		} else if (chosenClass.equalsIgnoreCase("rogue")){
			String rogueSpecializations[] = new String[]{
					"Poisions",
					"Daggers",
					"Bows",
					"Crossbows",
					"Stealth",
					"Thievery",
					"Dodging",
					"Traps",
					"Explosives"
			};
			return rogueSpecializations[arrayPlace];
		} else {
			String warriorSpecializations[] = new String[]{
					"Swords",
					"Maces",
					"Axes",
					"Heavy Armor",
					"Shields",
					"Unarmed Combat",
					"Polearms",
					"Dual Wielding",
					"Bezerking"
			};
			return warriorSpecializations[arrayPlace];
		}
	}
}